﻿using BCCommon.TMS.FreightEnums;
using BCEntity.TMS.FreightContact;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.FreightContact
{
    /// <summary>
    /// 货运常用联系人
    /// </summary>
    public interface IFreightContactData
    {
        /// <summary>
        /// 检查货运常用联系人记录是否存在
        /// </summary>
        /// <param name="freightContactId">货运常用联系人Id</param>
        /// <returns></returns>
        Task<bool> CheckFreightContactExistsAsync(long freightContactId);

        /// <summary>
        /// 检查货运常用联系人是否存在
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="phone">联系人手机号</param>
        /// <param name="freightContactType">货运联系人类型</param>
        /// <returns></returns>
        Task<object> CheckFreightContactExistsAsync(long userId, string phone, FreightContactType freightContactType);

        /// <summary>
        /// 检查货运常用联系人是否存在
        /// </summary>
        /// <param name="freightContactId">货运常用联系人Id</param>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        Task<object> CheckFreightContactExistsAsync(long freightContactId, long userId);

        /// <summary>
        /// 添加货运常用联系人
        /// </summary>
        /// <param name="entity">货运常用联系人</param>
        /// <returns></returns>
        Task<FreightContactEntity> InsertAsync(FreightContactEntity entity);

        /// <summary>
        /// 修改货运常用联系人
        /// </summary>
        /// <param name="entity">货运常用联系人</param>
        /// <returns></returns>
        Task<FreightContactEntity> UpdateAsync(FreightContactEntity entity);

        /// <summary>
        /// 获取货运常用联系人列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="freightContactType">货运联系人类型</param>
        /// <returns></returns>
        Task<IEnumerable<FreightContactEntity>> GetAsync(long userId, FreightContactType? freightContactType);
        /// <summary>
        /// 获取货运常用联系人
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="phone">联系人手机号</param>
        /// <param name="freightContactType">货运联系人类型</param>
        /// <returns></returns>
        Task<FreightContactEntity> GetAsync(long userId, string phone, FreightContactType freightContactType);
        /// <summary>
        /// 删除货运常用联系人
        /// </summary>
        /// <param name="freightContactId">货运常用联系人Id</param>
        /// <returns></returns>
        Task<int> DeleteAsync(long freightContactId);
    }
}